
<template>
  <!-- 统计报表 -->
  <div class="w1 h1 right-tab-container">
    <Tabs @on-click="handelChange" v-model="currentName">
      <TabPane label="日电量报表" name="first">
        <Dayly ref="daylyReportRef" v-if="currentName==='first'" />
      </TabPane>
      <TabPane label="月电量报表" name="second">
        <Monthly ref="monthlyReportRef" v-if="currentName==='second'" />
      </TabPane>
    </Tabs>
  </div>
</template>
<script>
import Dayly from "./Dayly"
import Monthly from "./Monthly"
export default {
  components: {
    Dayly,
    Monthly
  },
  created() {
    const currentName = sessionStorage.getItem("reportFormsLayout")
    if (currentName) {
      this.currentName = currentName
    }
  },
  data: () => ({
    currentName: "first"
  }),
  methods: {
    handelChange(name) {
      sessionStorage.setItem("reportFormsLayout", name)
      this.currentName = name
    }
  }
}
</script>
